from selenium.webdriver.common.by import By
from Base.Base import Base
from time import sleep
class Page(Base):
    #定位器
    #播放列表
    bofang_loc = (By.XPATH,'//*[@id="app"]/div/section/aside/ul/li/ul/li[7]/a')
    def bofang(self):
        self.click(self.bofang_loc)

    #登录
    login_loc = (By.XPATH,'//*[@id="app"]/div/section/aside/ul/li/ul/li[6]/a')
    def login(self):
        self.click(self.login_loc)

    #账号
    user_loc = (By.XPATH,'/html/body/div[1]/div/section/section/main/div[1]/div[2]/div[1]/div/input')
    def user(self):
        self.send_keys(self.user_loc,'gx')
    #密码
    pwd_loc = (By.XPATH,'/html/body/div[1]/div/section/section/main/div[1]/div[2]/div[2]/div/input')
    def pwd(self):
        self.send_keys(self.pwd_loc,'123')

    #登录
    loginbth_loc = (By.XPATH,'/html/body/div[1]/div/section/section/main/div[1]/div[2]/button[2]')
    def loginbth(self):
        self.click(self.loginbth_loc)
    #确认
    queren_loc = (By.XPATH,'/html/body/div/div/section/section/main/div[2]/div/div/div/div[2]/button[2]')
    def queren(self):
        self.click(self.queren_loc)

    def test_luoji_1(self):
        self.open_url('http://localhost:8080/')
        self.login()
        self.user()
        self.pwd()
        self.loginbth()
        self.queren()
